import random

import numpy as np
from sklearn.linear_model import LinearRegression

x = np.array(np.random.rand(100)).reshape(-1, 1)

print(x)
y = 3 * x + 100 + random.randint(10, 20)
print(y)

lr = LinearRegression()

model = lr.fit(x, y)
print(model.coef_)
print(model.intercept_)

print(model.predict([[100]]))